/**
 * 告警业务查询
 */
import request from '@/utils/request';

// 列表数据查询
export function getBusinessAlarm(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/alarm/business/getBusinessAlarm',
		method: 'post',
		data: query,
	});
}

// 列表数据查询
export function getYwgztBusinessNPMAlarm(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/ywgzt/business/getBaseNPMAlarmList',
		method: 'post',
		data: query,
	});
}

// 列表数据查询
export function getYwgztBusinessAlarm(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/ywgzt/business/getBusinessAlarm',
		method: 'post',
		data: query,
	});
}

//下载
export function exportYwgztExcel(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/ywgzt/business/exportExcel',
		method: 'post',
		data: query,
		responseType: 'blob',
	});
}

//下载
export function exportExcel(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/alarm/business/exportExcel',
		method: 'post',
		data: query,
		responseType: 'blob',
	});
}

// 业务列表数据查询
export function getBaseAlarmList(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/alarm/business/getBaseAlarmList',
		method: 'post',
		data: query,
		timeout: 600000,
		headers: {
			VERSION: 'lishilei',
		},
	});
}

//下载
export function exportBaseAlarmExcel(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/documentExportInfo/documentExport',
		method: 'post',
		data: query,
		responseType: 'blob',
		timeout: 600000,
		headers: {
			VERSION: 'lishilei',
		},
	});
}

// 根据id查询告警详情
export function getBusinessAlarmDetail(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/alarm/business/getBusinessAlarmDetail',
		method: 'get',
		params: query,
	});
}

// 根据步骤id查询business_detail
export function getBusinessDetailList(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/alarm/business/getBusinessDetailList',
		method: 'get',
		params: query,
	});
}

// 根据步骤id查询business_step
export function getStepDetailList(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/alarm/business/getStepDetailList',
		method: 'get',
		params: query,
		headers: {
			VERSION: 'lishilei',
		},
	});
}

// 查询非首端相关列表数据
export function reverseAnalysis(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/alarm/business/reverseAnalysis',
		method: 'post',
		data: data,
		timeout: 200000,
	});
}

// 查询非首端相关列表数据
export function getAlarmNPMDetailList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/ywgzt/business/getAlarmNPMDetailList',
		method: 'post',
		data: data,
	});
}

// 查询非首端相关列表数据
export function getAlarmNPMDetailListDownload(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/business-monitor/ywgzt/business/getAlarmNPMDetailListDownload',
		method: 'post',
		data: data,
		responseType: 'blob',
	});
}
